﻿using ARchGL.Platform.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace ARchGL.Platform.Core
{
    /// <summary>
    /// 千变_项目成员
    /// </summary>
    [Table(nameof(QB_ProjectUsers))]
    public class QB_ProjectUsers : QianbianEntityBase
    {
        /// <summary>
        /// 项目标识
        /// </summary>
        public Guid ProjectId { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        [MaxLength(50)]
        public string RealName { get; set; }
        /// <summary>
        /// 项目角色
        /// </summary>
        [MaxLength(50)]
        public string RoleName { get; set; }
        /// <summary>
        /// 工种
        /// </summary>
        [MaxLength(50)]
        public string WorkerType { get; set; }
        /// <summary>
        /// 项目成员标识
        /// </summary>
        public Guid UserId { get; set; }
        /// <summary>
        /// 性别：MALE：男 FEMALE：女
        /// </summary>
        [MaxLength(20)]
        public string Gender { get; set; }
        /// <summary>
        /// 脱敏后的身份证号
        /// </summary>
        [MaxLength(50)]
        public string IdNoMarked { get; set; }
        /// <summary>
        /// 身份证号SHA-1加密后的十六进制字符串
        /// </summary>
        [MaxLength(50)]
        public string IdCardSHA { get; set; }
        /// <summary>
        /// 人员类别：
        /// JS：建设单位人员
        /// JL：监理人员
        /// SG: 施工单位人员
        /// ZY：作业工人
        /// </summary>
        [MaxLength(20)]
        public string Type { get; set; }
        /// <summary>
        /// 人员类别中文名称
        /// </summary>
        public string TypeName
        {
            get
            {
                switch (Type)
                {
                    case "JS": return "建设单位人员";
                    case "JL": return "监理人员";
                    case "SG": return "施工单位人员";
                    case "ZY": return "作业工人";
                    case "HQ": return "后勤";
                    case "ST": return "食堂";
                    case "ZJY": return "质检员";
                    case "CLY": return "材料员";
                    case "SJG": return "试件工";
                    case "YSY": return "预算员";
                    case "AQY": return "安全员";
                    case "DHZ": return "栋号长";

                    case "CELY": return "测量员";
                    case "XMZG": return "项目总工";
                    case "XMJL": return "项目经理";
                    case "ZILY": return "资料员";
                    case "XMZJ": return "项目总监";
                    case "XCJL": return "现场经理";
                    case "JXGLY": return "机械管理员";
                }
                return "其他人员";
            }
        }
    }
}
